package com.rongzhe.house.house.dao;

import com.rongzhe.house.house.criteria.HouseCriteria;
import com.rongzhe.house.house.criteria.HouseMapCriteria;
import com.rongzhe.house.house.entity.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface HouseBaseMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(HouseBase record);

    int insertSelective(HouseBase record);

    HouseBase selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(HouseBase record);

    int updateByPrimaryKey(HouseBase record);

    List<HouseOverview> selectHouseByCriteria(HouseCriteria houseCriteria);


    List<HouseOverview> selectExcellentHouse(String cityId);
    List<HouseOverview> getExcellentHouse(HouseCriteria houseCriteria);
    long countExcellentHouse(HouseCriteria houseCriteria);

    HouseDetail selectDetailById(Integer houseId);

    int countHouseByCriteria(HouseCriteria houseCriteria);

    List<HouseLiveInfoOverview> selectHouseLiveInfo(@Param("houseId") Integer houseId);

    List<HouseOverview> selectHouseByIds(@Param("ids") List<Long> ids,@Param("orderStr") String orderStr,@Param("order") String order);

    /**
     * 地图搜索区域房数
     * @param houseCriteria
     * @return
     */
    List<HouseMapCriteria> queryStreetMapCount(HouseMapCriteria houseCriteria);

    List<HouseMapCriteria> queryCountyCount(HouseMapCriteria houseCriteria);

    List<HouseMapCriteria> queryTownCount(HouseMapCriteria houseCriteria);

    List<HouseTag> queryHouseTagById(Integer houseId);
}